#include <bits/stdc++.h>
using namespace std;

int main(){
    string line, tmp;
    while(getline(cin, line)){
        stringstream ss;
        ss << line;
        vector<string> str;
        while(ss >> tmp){
            str.push_back(tmp);
        }
        reverse(str.begin(), str.end());
        int l = str.size();
        for(int i = 0; i < l; ++i){
            cout << str[i];
            if(i != l - 1) cout << " ";
        }
        cout << endl;
    }
}